import request from '@/utils/axiosRequest'
import useEnv from "@/hooks/useEnv";
const show = useEnv.VITE_FILE_API + "/shows?uuid="

const getReportTyps = (x) => {
    return request({
        url: '/reportType/selectByPag?index=' + x.index + '&size=' + x.size + '&searchName=' + x.searchName
    })
}

const addReportTyp = (data) => {
    return request({
        url: '/reportType/add',
        data: data,
        method: 'post'
    })
}

const updateReportTyp = (data) => {
    return request({
        url: '/reportType/update',
        data: data,
        method: 'post'
    })
}
const delReportType = (id) => {
    return request({
        url: '/reportType/delete?id=' + id,
        method: 'delete'
    })
}

const getReports = (x) => {
    return request({
        url: '/report/selectByPag?index=' + x.index + '&size=' + x.size + '&searchName=' + x.searchName +
            '&searchValue1=' + x.searchValue1 + '&searchValue2=' + x.searchValue2 + '&searchValue3=' + x.searchValue3
    })
}

const handleReport = (id, status) => {
    return request({ url: '/report/handle?id=' + id + '&status=' + status })
}




export default {
    getReportTyps,
    addReportTyp,
    updateReportTyp,
    delReportType,
    getReports,
    handleReport,
    show
}